package com.lmh.graphdisease.repository;

import com.lmh.graphdisease.entity.UserEntity;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.stereotype.Repository;

/**
 * @author lmh
 * @desc
 * @date 2023/4/12
 */
@Repository
public interface UserRepository extends Neo4jRepository<UserEntity,Long> {

    UserEntity findUserEntityByUsername(String name);

    @Query("CREATE(u:User {identity:'regular',name:$0,username:$1,password:$2})")
    void addNormalUser(String name,String username,String password);

}
